Replace Inequality Comparison with Equality Comparison (RICEC)

Description:

The RICEC audit generates a message in situations when ranges of compared operands intersect only in one point, so the inequality comparison can be replaced with the equality comparison. Such a message can be caused by an error in the program, when the programmer has the wrong assumption about ranges of compared operands. However, even if this inequality comparison is correct, replacing it with an equality comparison can make the code easier to understand.

Incorrect:

public void foo(char c, int i) { 
    if (c <= 0) {
        if ((i & 1) > 0) { 
            ...
        } 
    }  
}

Correct:

public void foo(char c, int i) { 
    if (c == 0) { 
        if ((i & 1) != 0) { 
            ...
        } 
    }  
}